package cn.zane.designPattern.createPatterns.abstractFactoryPatterns.design;

import cn.zane.designPattern.createPatterns.abstractFactoryPatterns.design.factory.JDKProxyFactory;
import cn.zane.designPattern.createPatterns.abstractFactoryPatterns.design.workshop.impl.EGMCacheAdapter;
import cn.zane.designPattern.createPatterns.abstractFactoryPatterns.design.workshop.impl.IIRCacheAdapter;
import cn.zane.designPattern.createPatterns.abstractFactoryPatterns.oldCode.application.CacheService;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: zane
 * @Date: 2024/12/29
 * @Description:
 */
@Slf4j
public class AbstractFactoryPatternsMain {

    public static void main(String[] args) throws Exception {
        CacheService proxy_EGM = JDKProxyFactory.getProxy(CacheService.class, EGMCacheAdapter.class);
        proxy_EGM.set("user_name_01", "zane01");
        String val01 = proxy_EGM.get("user_name_01");
        log.info("缓存服务EGM测试,proxy_EGM.get 测试结果:{}", val01);

        CacheService proxy_IIR = JDKProxyFactory.getProxy(CacheService.class, IIRCacheAdapter.class);
        proxy_IIR.set("user_name_02", "zane02");
        String val02 = proxy_IIR.get("user_name_02");
        log.info("缓存服务IIR测试,proxy_IIR.get 测试结果:{}", val02);
    }
}
